var a = wx.createInnerAudioContext();

a.loop = !0;

var t, n, l = getApp();

Page({
    data: {
        data_wenan: "",
        data_wenan2: "",
        data_peitu: "",
        data_animation: "headRotate 5s linear infinite",
        data_beijing: l.globalData.linkbeijing,
        data_yyurl: l.globalData.linkmusicurl,
        data_sudu: l.globalData.linkfontspeed,
        data_yytp: "http://inews.gtimg.com/newsapp_ls/0/13215955736/0",
        data_display: "",
        data_display2: "none"
    },
    view_B_a1_tap: function(t) {
        "headRotate 5s linear infinite" == this.data.data_animation ? (a.pause(), this.setData({
            data_animation: "0",
            data_yytp: "http://inews.gtimg.com/newsapp_ls/0/13215956519/0"
        })) : (a.play(), this.setData({
            data_animation: "headRotate 5s linear infinite",
            data_yytp: "http://inews.gtimg.com/newsapp_ls/0/13215955736/0"
        }));
    },
    view_D_tap: function(a) {
        l.globalData.linkbeijing = this.data.data_beijing, l.globalData.linkpeitu = this.data.data_peitu, 
        l.globalData.linkwenan = this.data.data_wenan2, l.globalData.linkfontcolor = this.data.data_color, 
        wx.redirectTo({
            url: "/pages2/bianji/index"
        });
    },
    onLoad: function(n) {
        t = Math.floor(Math.random() * l.globalData.yulanwenan.length), this.setData({
            data_wenan: l.globalData.yulanwenan[t].txt,
            data_wenan2: l.globalData.yulanwenan[t].txt
        }), console.log(l.globalData.yulanwenan[t].txt), t = Math.floor(Math.random() * l.globalData.yulanyinyue.length), 
        a.src = l.globalData.yulanyinyue[t].src, a.play(), l.globalData.linkmusicurl = l.globalData.yulanyinyue[t].src, 
        l.globalData.linkgeming = "(" + l.globalData.yulanyinyue[t].name + ")", t = Math.floor(Math.random() * l.globalData.yulanpeitu.length), 
        this.setData({
            data_peitu: l.globalData.yulanpeitu[t].src
        }), this.setData({
            data_yyurl: l.globalData.linkmusicurl,
            data_beijing: l.globalData.linkyulanback,
            data_size: l.globalData.linkfontsize,
            data_sudu: l.globalData.linkfontspeed
        }), 0 == l.globalData.linkfontcolor2 ? this.setData({
            data_color: "#000"
        }) : this.setData({
            data_color: "#fff"
        });
    },
    onShow: function(a) {
        var t = this;
        setTimeout(function() {
            t.setData({
                data_display: "none"
            });
            var a = 1;
            n = setInterval(function() {
                a <= t.data.data_wenan2.length ? (t.setData({
                    data_wenan: t.data.data_wenan2.substring(0, a),
                    data_display2: "block"
                }), a += 1) : clearInterval(n), console.log("滚动中");
            }, t.data.data_sudu);
        }, 200);
    },
    onUnload: function() {
        clearInterval(n), a.stop();
    },
    onShareAppMessage: function() {}
});